﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevToolBox.Cloud.Common
{
    /// <summary>
    /// Class to encapsulate the required information 
    /// to create new table-like storage
    /// </summary>
    public class TableInfo
    {
        public const string HashKeyName = "HashKey"; //aka PartitionKey;
        public const string RangeKeyName = "RangeKey";    //aka RowKey;

        public string Name { get; set; }
        public string HashKey { get; set; }
        public string HashKeyType { get; set; }
        public string RangeKey { get; set; }
        public string RangeKeyType { get; set; }

        /// <summary>
        /// Constructor without default values
        /// </summary>
        /// <param name="name">Table name</param>
        /// <param name="key">Main/primary key</param>
        /// <param name="keyType">Main/primary key data type</param>
        /// <param name="range">Secondary key name</param>
        /// <param name="rangeType">Secondary key data type</param>
        public TableInfo(string name, string key, string keyType, 
                         string range, string rangeType)
        {
            Name = name;
            HashKey = key;
            HashKeyType = keyType;
            RangeKey = range;
            RangeKeyType = rangeType;
        }

        /// <summary>
        /// Constructor with default string ("S") data types
        /// </summary>
        /// <param name="name">Table name</param>
        /// <param name="key">Main/primary key</param>
        /// <param name="range">Secondary key name</param>
        public TableInfo(string name, string key, string range)
        {
            Name = name;
            HashKey = key;
            HashKeyType = "S";
            RangeKey = range;
            RangeKeyType = "S";
        }

    }
}
